package com.aopcinemas.cinema.behaviour;

import jade.core.Agent;

import com.aopcinemas.cinema.CinemaAgent;
import com.aopcinemas.cinema.CinemaUtils;
import com.aopcinemas.cinema.model.Cinema;
import com.aopcinemas.common.model.AbstractRegistrationBehavior;

public class CinemaRegistrationBehaviour extends AbstractRegistrationBehavior {

    private static final long serialVersionUID = 1L;

    private Cinema cinema;

    public CinemaRegistrationBehaviour(Agent agent, Cinema cinema) {
        this(agent, cinema, REGISTER);
    }

    public CinemaRegistrationBehaviour(Agent agent, Cinema cinema, int action) {
        super(agent, action);
        this.cinema = cinema;
    }

    @Override
    protected void doRegister() {
        CinemaUtils.registerCinema((CinemaAgent) myAgent, cinema);
    }

    @Override
    protected void doUnregister() {
        CinemaUtils.unregisterCinema((CinemaAgent) myAgent);
    }

}
